package com.hitrust.gs.dao;

import com.hitrust.gs.bean.GSOperateRecord;
import com.hitrust.gs.lib.db.GSBaseDAO;
import com.hitrust.gs.util.exception.GSException;

public class GSOperateRecordDao extends GSBaseDAO{

	private final  String insertSql = " insert into operate_record ("+
	"OPERATE_TYPE,"+
	"OPERATE_CONTENT,"+
	"OPERATE_TIME,"+
	"OPERATE_USER_ID,"+
	"OPERATE_USER_NAME,"+
	"RECORD_ID,"+
	"STATUS,"+
	"REMARK,"+
	"ID"+
	") values (?,?,?,?,?,?,?,?,(select sys_guid() from dual))";
	
	
	public boolean insert (GSOperateRecord vo) throws GSException{
		String tSql = this.insertSql;
		Object[] tobj = new Object[8];
		tobj[0] = String.valueOf(vo.getOPERATE_TYPE());
        tobj[1] = vo.getOPERATE_CONTENT();
        tobj[2] = vo.getOPERATE_TIME();
        tobj[3] = vo.getOPERATE_USER_ID();
        tobj[4] = vo.getOPERATE_USER_NAME();
        tobj[5] = vo.getRECORD_ID();
        tobj[6] = vo.getSTATUS();
        tobj[7] = vo.getREMARK();
		try {
			return this.executeUpdate(tSql, tobj);
		} catch (Exception e) {
			throw new GSException(GSException.E20042,GSException.E20042_MSG);
		}
	}
}
